package Particles 
{
    public class ParticleEmitter
	{
		public var name:String;
        public var frequency:int = 0;
        public var blend:String="";
		public var columns:int=1;
		public var rows:int=1;
        public var animSpeed:Number = 1;
		public var particleCls:Class;
		public var duration:int=0;
		public var locateX:int=0;
		public var locateY:int=0;
		public var frames:Array=[];

        public function ParticleEmitter()
		{
            super();
        }
        public function emitOnto(particleLayer:ParticleLayer, x:Number, y:Number,appendFunc:Function=null):void
		{
            var index:int;
            while (index < frequency)
			{
				var particle:Particle =new particleCls();
				particle.index=index;
				particle.duration=duration;
                particle.x = x;
                particle.y = y;
				particle.layer = particleLayer;
				particle.frames=frames;
                particle.animSpeed = animSpeed;
				particle.handleX=locateX/frames[0].width;
				particle.handleY=locateY/frames[0].height;
				particle.blend = blend;
				appendParticle(particle);
				if(appendFunc)
				{
					appendFunc(particle);
				}
               	particleLayer.addParticle(particle);
				index++;
            }
        }
		
		protected function appendParticle(particle:Particle):void
		{
			
		}
    }
}